package com.jade.explorer.views;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

import com.jade.explorer.dirscan.FileType;
import com.jade.explorer.dirscan.TreeObject;

public class ViewLabelProvider extends LabelProvider {

	public String getText(Object obj) {
		return obj.toString();
	}
	
	public Image getImage(Object obj) {
		String sn = JadeSharedImages.IMG_EMPTY_FILE;	//symbolicName
		TreeObject to = (TreeObject) obj;
		FileType ft = to.getType();
		switch (ft){
			case IMAGE : sn = JadeSharedImages.IMG_IMAGE; break;
			case ANISOTROPY : sn = JadeSharedImages.IMG_ANISOTROPY_GREEN; break;
			case OBJECT : sn = JadeSharedImages.IMG_LAYER_SHAPE; break;
			case FOLDER : sn = JadeSharedImages.IMG_FOLDER_OPEN; break;
			case PROJECT : sn = JadeSharedImages.IMG_FOLDER_STAND; break;
			case DOMAIN : sn = JadeSharedImages.IMG_DOMAIN_GORIZOTAL; break;
			case UNKNOWN : sn = JadeSharedImages.IMG_DOCUMENT_SAD; break;
			case HIDDEN : sn = JadeSharedImages.IMG_EMPTY_FILE; break;
			default : sn = JadeSharedImages.IMG_EMPTY_FILE; break;
		}
		return JadeSharedImages.getImage(sn);
	}
}
